/**
 * Tencent is pleased to support the open source community by making Tseer available.
 *
 * Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
 * 
 * Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * 
 * https://opensource.org/licenses/BSD-3-Clause
 *
 * Unless required by applicable law or agreed to in writing, software distributed 
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */

// **********************************************************************
// This file was generated by a TARS parser!
// TARS version 1.0.1.
// **********************************************************************

package com.qq.cloud.router.client.share.tseer;

import com.qq.tars.protocol.util.*;
import com.qq.tars.protocol.annotation.*;
import com.qq.tars.protocol.tars.*;
import com.qq.tars.protocol.tars.annotation.*;

@TarsStruct
public class AgentRouterRequest {

	@TarsStructProperty(order = 1, isRequire = false)
	public int getType = 0;
	@TarsStructProperty(order = 2, isRequire = false)
	public int lbType = 0;
	@TarsStructProperty(order = 3, isRequire = false)
	public String obj = "";
	@TarsStructProperty(order = 4, isRequire = false)
	public String setname = "";
	@TarsStructProperty(order = 5, isRequire = false)
	public long tid = 0L;
	@TarsStructProperty(order = 6, isRequire = false)
	public String apiVer = "";
	@TarsStructProperty(order = 7, isRequire = false)
	public long hashKey = 0L;
	@TarsStructProperty(order = 8, isRequire = false)
	public String identifier = "";

	public int getGetType() {
		return getType;
	}

	public void setGetType(int getType) {
		this.getType = getType;
	}

	public int getLbType() {
		return lbType;
	}

	public void setLbType(int lbType) {
		this.lbType = lbType;
	}

	public String getObj() {
		return obj;
	}

	public void setObj(String obj) {
		this.obj = obj;
	}

	public String getSetname() {
		return setname;
	}

	public void setSetname(String setname) {
		this.setname = setname;
	}

	public long getTid() {
		return tid;
	}

	public void setTid(long tid) {
		this.tid = tid;
	}

	public String getApiVer() {
		return apiVer;
	}

	public void setApiVer(String apiVer) {
		this.apiVer = apiVer;
	}

	public long getHashKey() {
		return hashKey;
	}

	public void setHashKey(long hashKey) {
		this.hashKey = hashKey;
	}

	public String getIdentifier() {
		return identifier;
	}

	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}

	public AgentRouterRequest() {
	}

	public AgentRouterRequest(int getType, int lbType, String obj, String setname, long tid, String apiVer, long hashKey, String identifier) {
		this.getType = getType;
		this.lbType = lbType;
		this.obj = obj;
		this.setname = setname;
		this.tid = tid;
		this.apiVer = apiVer;
		this.hashKey = hashKey;
		this.identifier = identifier;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + TarsUtil.hashCode(getType);
		result = prime * result + TarsUtil.hashCode(lbType);
		result = prime * result + TarsUtil.hashCode(obj);
		result = prime * result + TarsUtil.hashCode(setname);
		result = prime * result + TarsUtil.hashCode(tid);
		result = prime * result + TarsUtil.hashCode(apiVer);
		result = prime * result + TarsUtil.hashCode(hashKey);
		result = prime * result + TarsUtil.hashCode(identifier);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof AgentRouterRequest)) {
			return false;
		}
		AgentRouterRequest other = (AgentRouterRequest) obj;
		return (
			TarsUtil.equals(getType, other.getType) &&
			TarsUtil.equals(lbType, other.lbType) &&
			TarsUtil.equals(obj, other.obj) &&
			TarsUtil.equals(setname, other.setname) &&
			TarsUtil.equals(tid, other.tid) &&
			TarsUtil.equals(apiVer, other.apiVer) &&
			TarsUtil.equals(hashKey, other.hashKey) &&
			TarsUtil.equals(identifier, other.identifier) 
		);
	}

	public void writeTo(TarsOutputStream _os) {
		_os.write(getType, 1);
		_os.write(lbType, 2);
		if (null != obj) {
			_os.write(obj, 3);
		}
		if (null != setname) {
			_os.write(setname, 4);
		}
		_os.write(tid, 5);
		if (null != apiVer) {
			_os.write(apiVer, 6);
		}
		_os.write(hashKey, 7);
		if (null != identifier) {
			_os.write(identifier, 8);
		}
	}

	public void readFrom(TarsInputStream _is) {
		this.getType = (int) _is.read(getType, 1, false);
		this.lbType = (int) _is.read(lbType, 2, false);
		this.obj = _is.read(obj, 3, false);
		this.setname = _is.read(setname, 4, false);
		this.tid = _is.read(tid, 5, false);
		this.apiVer = _is.read(apiVer, 6, false);
		this.hashKey = _is.read(hashKey, 7, false);
		this.identifier = _is.read(identifier, 8, false);
	}

}
